# Maintainer: Laurent Bercot <ska-devel@skarnet.org>
# Contributor: Laurent Bercot <ska-devel@skarnet.org>
pkgname=mdevd
pkgver=0.1.5.2
pkgrel=0
pkgdesc="A netlink-listening device manager using mdev's configuration files"
url="https://skarnet.org/software/mdevd/"
arch="all"
license="ISC"
options="!check"  # no tests provided
depends_openrc="mdevd mdev-conf"
makedepends="linux-headers skalibs-dev>=2.12"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://skarnet.org/software/mdevd/mdevd-$pkgver.tar.gz
	$pkgname.initd
        mdevd-init.initd"

build() {
	./configure \
		--enable-shared \
		--enable-static \
		--disable-allstatic
	make
}

package() {
	make install DESTDIR="$pkgdir"
	mkdir -p "$pkgdir/usr/share/doc" "$pkgdir/etc/init.d"
	cp -a doc "$pkgdir/usr/share/doc/$pkgname"
	install -m 755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -m 755 "$srcdir"/mdevd-init.initd "$pkgdir"/etc/init.d/mdevd-init
}

sha512sums="
50d0b517255bc8acc25b226822186a6315569e7691511bca44a274e18bd443b9ff70e99884ffb9467c9ec85af2a1bd5256b05c92905eeca67ee14b98cd0b540d  mdevd-0.1.5.2.tar.gz
3d826495788b1530548e090675f91fe4828f78a95b3b24cb4c73b92f5d5c16b103e6c25a2591d2d0bd17da2d16fa59d1214e70d936930f25cd9872dfd202585b  mdevd.initd
d713aaf38c3507a0c3080df6e4990c4f9781a20141aa89a7116b817154c0a34e74fd4d2d9ee00467d4cbcd89d178c99ae389a9d34ad0fb956a173b89123d48ff  mdevd-init.initd
"
